package cn.gyn.gynrpc.demo.provider;

import cn.gyn.gynrpc.core.annotation.GynProvider;
import cn.gyn.gynrpc.demo.api.Order;
import cn.gyn.gynrpc.demo.api.OrderService;
import org.springframework.stereotype.Component;

@Component
@GynProvider
public class OrderServiceImpl implements OrderService {
    @Override
    public Order findById(Integer id) {
        //在这里给id404的模拟服务器异常抛出
        if(id == 404){
            throw new RuntimeException("404 Exception");
        }
        return new Order(id,15.8f);
    }
}
